import request from '../utils/request.js';


/**
 * 首页轮播图
 * @param posId
 * @returns {*}
 */
export const getBanners = (posId) => {

    let url = `/api/v1/banner/bypos?id=${posId}`;

    return request.get(url);
}


/**
 * 资讯分类
 * @returns {*}
 */
export const getNewsCate = () => {

    let url = `/api/cate/flist`;

    return request.get(url);
}


/**
 * 资讯列表
 * @param cateId
 * @param currentPage
 * @param pageSize
 * @returns {*}
 */
export const getNewsListByCateId = (cateId, currentPage = 1, pageSize = 5) => {

    let url = `/api/news/flist?pageSize=${pageSize}&cate_id=${cateId}&currentPage=${currentPage}`;

    return request.get(url);
}
